package observer2;

import java.util.Observable;
import java.util.Observer;

/*一个观察者接口*/
public class User1Observer implements Observer {
    private String name;

    public User1Observer(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(name + "收到通知:" + arg);
    }
}
